package com.sds.batch.sample;

import java.util.Collection;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;

public class ExampleItemProcessor implements ItemProcessor<String, String> {
	
	private Logger logger = LoggerFactory.getLogger(ExampleItemProcessor.class);
	
	private String jobName;
	private String stepName;
	private Collection jobParameters;

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}
	
	public void setStepName(String stepName) {
		this.stepName = stepName;
	}
	
	public void setJobParameters(Collection jobParameters) {
		this.jobParameters = jobParameters;
	}
	
	@Override
	public String process(String arg0) throws Exception {
		logger.debug("@@@===========================================");
		logger.debug("Processor Read String From Reader :");
		logger.debug(arg0);
		logger.debug("@@@===========================================");
		
		logger.info("############################################");
		logger.info("Job Name       : " + jobName);
		logger.info("Step Name      : " + stepName);
		logger.info("Job Parameters : " + jobParameters);
		logger.info("############################################");
		
		return "Test Output";
	}

}
